From 73307f78dc8a10a2db2a0979ec7ede40f367b781 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 22 Jan 2016 22:49:01 -0500 Subject: [PATCH] box gadget: Don't allow shifting too far We don't want to let baseline adjustment shift the child out of the original allocation. This is purely a sanity measure - in practice, the baseline should always be bigger than the child_baseline. --- gtk/gtkboxgadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkboxgadget.c b/gtk/gtkboxgadget.c index cf9cb7314a..ea18a21c28 100644 --- a/gtk/gtkboxgadget.c +++ b/gtk/gtkboxgadget.c @@ -314,7 +314,7 @@ gtk_box_gadget_allocate_child (GObject *child, if (minimum_baseline >= 0 && baseline >= 0) { child_allocation.height = MIN(natural, allocation->height); - child_allocation.y = allocation->y + baseline - minimum_baseline; + child_allocation.y = allocation->y + MAX(0, baseline - minimum_baseline); break; } case GTK_ALIGN_CENTER: -- 2.30.2